package PTA;
class Animal {
    public void cry() {
        System.out.println("动物叫......");
    }
}
class Dog extends Animal {
    @Override
    public void cry() {
        System.out.println("汪汪汪......");
    }
}
class Cat extends Animal {
    @Override
    public void cry() {
        System.out.println("喵喵喵......");
    }
}
class Duck extends Animal {
    @Override
    public void cry() {
        System.out.println("嘎嘎嘎......");
    }
}
class Host {
    public void letCry(Animal animal) {
        animal.cry();
    }
}
public class t15 {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Host host=new Host();
        Animal animal=new Dog();
        host.letCry(animal);
        animal=new Cat();
        host.letCry(animal);
        animal=new Duck();
        host.letCry(animal);
    }
}
